﻿using EPiServer;
using EPiServer.DynamicContent;

namespace SocialPack.modules.SocialPack.DynamicContent.Facebook
{
    [DynamicContentPlugIn(
        DisplayName = "Facebook Comments",
        Description = "Displays Facebook Comments",
        ViewUrl = "~/modules/socialpack/dynamiccontent/facebook/comments.ascx")]
    public partial class Comments : UserControlBase
    {
        public int Width { get; set; }
        public int MaxCount { get; set; }

        public string CountryCode { get; set; }

        protected override void OnLoad(System.EventArgs e)
        {
            base.OnLoad(e);

            this.CommentsControl.Width = this.Width;
            this.CommentsControl.MaxCount = this.MaxCount;

            if (!string.IsNullOrWhiteSpace(this.CountryCode))
            {
                this.CommentsControl.CountryCode = this.CountryCode;
            }
        }
    }
}